//
//  AViewController.m
//  BlockDemo2
//
//  Created by mobao on 16/4/12.
//  Copyright © 2016年 mobao. All rights reserved.
//

#import "AViewController.h"

#import "BViewController.h"

@implementation AViewController

-(void)viewDidLoad{
    [super viewDidLoad];
    
}
- (IBAction)push:(id)sender {
    
    BViewController *bViewC = [self.storyboard instantiateViewControllerWithIdentifier:@"BViewController"];
    
    __weak AViewController *weakSelf = self;
    
    bViewC.callBackBlock = ^(NSString *text){
        NSLog(@"text is %@",text);
        
        weakSelf.label.text = text;
    };
    [self.navigationController pushViewController:bViewC animated:YES];
}

@end
